package com.example.javasystem.utils;

import com.example.javasystem.service.ResourceService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class SchedulerTaskCenter {

    @Resource
    protected ResourceService resourceService;

//    @Scheduled(fixedRate = 5000)
    //每四小时执行一次
    @Scheduled(cron = "0 0 0/4 * * ? ")
    public void cleanData(){
        resourceService.cleanData();
    }
}
